//
//  KeyframeAnimationDelegate.m
//  Home
//
//  Created by 曹连华 on 2019/6/28.
//  Copyright © 2019 曹连华. All rights reserved.
//

#import "KeyframeAnimationDelegate.h"

@implementation KeyframeAnimationDelegate

#pragma mark - CAAnimationDelegate
- (void)animationDidStart:(CAAnimation *)anim {
    NSLog(@"动画开始! anim = %@",anim);
    
}

/**
 * flag参数表明了动画是自然结束还是被打断,
 比如调用了removeAnimationForKey:方法或removeAnimationForKey方法，flag为NO，如果是正常结束，flag为YES
 */
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
    
    if (flag) {
        NSLog(@"动画 - 正常结束! anim = %@ flag = %d",anim,flag);
    } else {
        NSLog(@"动画 - 被打断结束! anim = %@ flag = %d",anim,flag);
    }
    
}

@end
